from flask import Blueprint,render_template

from app.models import db
from app.models import User
blue = Blueprint('blue',__name__)

@blue.route('/')
def index():
    return render_template('index.html',mesage="今天天气真好")


@blue.route('/createdb/')
def createdb():
    db.create_all()
    return '创建成功'

@blue.route('/dropdb/')
def dropedb():
    db.drop_all()
    return '删除成功'

@blue.route('/adduser/')
def adduser():
    user = User()
    user.username = "tom"
    db.session.add(user)

    return "添加成功"